<?php
/**
 * Created by PhpStorm.
 * User: Aliaksei Lazerka
 * Date: 9/28/14
 * Time: 11:06 AM
 */

namespace parser;

if (!defined('NYMPH_ROOT')) {
  define('NYMPH_ROOT', dirname("../../../../" . __FILE__));
  require(NYMPH_ROOT . '/local/loader/kernel/classes/URLClassLoader.php');
}

/**
 * The XML class provides the main functional
 * to save xml tags and it's attributes
 */
class XML
{
  /**
   * @var string tag
   */
  private $tag;

  /**
   * @var array array with string attributes
   */
  private $tagAttributes;

  /**
   * @var array array with inner tags
   */
  private $innerTags;

  /**
   * @return string
   */
  public function getTag()
  {
    return $this->tag;
  }

  /**
   * @param string $tag
   */
  public function setTag($tag)
  {
    $this->tag = $tag;
  }

  /**
   * @return array
   */
  public function getInnerTags()
  {
    return $this->innerTags;
  }

  /**
   * @param array $innerTags
   */
  public function setInnerTags($innerTags)
  {
    $this->innerTags = $innerTags;
  }

  /**
   * @return array
   */
  public function getTagAttributes()
  {
    return $this->tagAttributes;
  }

  /**
   * @param array $tagAttributes
   */
  public function setTagAttributes($tagAttributes)
  {
    $this->tagAttributes = $tagAttributes;
  }

  /**
   * Adds attribute to the current
   * @param XMLAttribute $tagAttribute
   */
  public function addTagAttribute($tagAttribute)
  {
    $this->tagAttributes[] = $tagAttribute;
  }

  /**
   * Adds inner tag to the current tag
   * @param XML $tag
   */
  public function addInnerTag($tag)
  {
    $this->innerTags[] = $tag;
  }


}